package lk.icta.common.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author Supun Viraj Rathnayaka
 *
 */
@Entity
@Table(schema = "COMMON_RAIL")
@NamedQueries({
        @NamedQuery(name = "getAllInstitutes", query = "SELECT i FROM Institute i")
})
public class Institute implements Serializable{

    public enum Type {
        GOVERNMENT,   // 0 - Government Sector Institute
        PRIVATE,      // 1 - Private Sector Institute
        UNKNOWN       // 2 - Institute in Unknown Sector
    }

    /**
     * A system generated unique key
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(nullable = false, unique = true, updatable = false)
    private String siInstituteName;
    @Column(nullable = false, unique = true, updatable = false)
    private String enInstituteName;
    @Column(nullable = false, unique = true, updatable = false)
    private String taInstituteName;

    /**
     * Type of the institute. Govt or Private
     */
    @Column(nullable = true)
    private Type type;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getSiInstituteName() {
        return siInstituteName;
    }

    public void setSiInstituteName(String siInstituteName) {
        this.siInstituteName = siInstituteName;
    }

    public String getEnInstituteName() {
        return enInstituteName;
    }

    public void setEnInstituteName(String enInstituteName) {
        this.enInstituteName = enInstituteName;
    }

    public String getTaInstituteName() {
        return taInstituteName;
    }

    public void setTaInstituteName(String taInstituteName) {
        this.taInstituteName = taInstituteName;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }
}
